package com.ruoyi.common.gscUtil.StudyUtil.MultiDataSourceUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 *  测试多数据源
 * 在 Spring Boot 的主类或测试类中调用 Service 方法，测试多数据源是否正常工作。
 *
 */
//@SpringBootApplication
public class MultiDataSourceApplication4 implements CommandLineRunner {

    @Autowired
    private MyService3 myService;

    public static void main(String[] args) {
        SpringApplication.run(MultiDataSourceApplication4.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        myService.queryFromDb1();
        myService.queryFromDb2();
    }
}